using System;
using System.Collections.Generic;
using System.Text;

namespace interfaces
{
    public static class Keyword
    {
		/// <summary>
		/// retrofit stage type
		/// </summary>
		public enum stage_t
		{
			ORIGINAL_ST,
			RETROFIT_ST,
			NUM_ST
		};

        /// <summary>
        /// energy output type
        /// </summary>
        public enum keyword_t 
        { 
			KWT_030101,
			KWT_030102,
			KWT_030201,
			KWT_030301,
			KWT_030302,
			KWT_030401,
			KWT_030501,
			KWT_030502,
			KWT_030601,
//			KWT_040101,
//			KWT_040401,
			KWT_050101,
			KWT_050201,
			KWT_050401,
			KWT_050402,
			KWT_050501,
			KWT_060101,
			KWT_060102,
//			KWT_070101,
//			KWT_090101,
            NUM_KWT
        };


        /// <summary>
        /// energy output type
        /// </summary>
        public enum energy_cat_t
        {
            Heating_ECT,
            Cooling_ECT,
            Fan_ECT,
            Pump_ECT,
            CoolingTower_ECT,
            Refrigeration_ECT,
            IntLighting_ECT,
            ExtLighting_ECT,
            IntEquipmentEle_ECT,
            IntEquipmentGas_ECT,
			Transportation_ECT,
			DHW_ECT,
            NUM_ECT
        };
		
		/// <summary>
        ///  result output table type.
        /// </summary>
        public enum table_t
        {
            Envelope_TT,
            Roof_TT,
			Window_TT,
			Infiltration_TT,
            IntLight_TT,
            IntEquipment_TT,
            ExtLighting_TT,
            Refrigeration_TT,
            Heating_TT,
			Cooling_TT,
			Fan_TT,
            Baseline_TT,
            NUM_TT
        };

		// energy catgory list
		public static List<string> m_energy_cat = new List<string>(new string[]
        {
            "Heating",
            "Cooling",
            "Fan",
            "Pump",
            "CoolingTower",
            "Refrigeration",
            "IntLight",
            "ExtLight",
            "IntEquipmentEle",
            "IntEquipmentGas",
			"Transportation",		
			"DHW"
        });


		// result output table list
		public static string[] m_table = new string[] 
        {
            "Envelope",
            "Roof",
			"Window",
			"Infiltration",
            "IntLight",
            "IntEquipment",
            "ExtLight",
            "Refrigeration",
            "Heating",
			"Cooling",
			"Fan",
            "Baseline"
        };

/*		public static Boolean[] m_factorTable = new Boolean[]
		{
			false,	// envelope
			false,	// roof
			false,	// window
			false,	// infiltration
			true,	// intlight
			true,	// intequipment
			true,	// extlight
			true,	// refrigeration
			false,	// heating
			false,	// cooling
			false,	// fan
			false,	// baseline
		};
*/
		public static energy_cat_t[] m_factorBaseEnergy = new energy_cat_t[]
		{
			energy_cat_t.NUM_ECT,			// envelope
			energy_cat_t.NUM_ECT,			// roof
			energy_cat_t.NUM_ECT,			// window
			energy_cat_t.NUM_ECT,			// infiltration
			energy_cat_t.IntLighting_ECT,	// intlight
			energy_cat_t.IntEquipmentEle_ECT,// intequipment
			energy_cat_t.ExtLighting_ECT,	// extlight
			energy_cat_t.Refrigeration_ECT,	// refrigeration
			energy_cat_t.NUM_ECT,			// heating
			energy_cat_t.NUM_ECT,			// cooling
			energy_cat_t.NUM_ECT,			// fan
			energy_cat_t.NUM_ECT,			// baseline
		};


        /// <summary>
        /// energy form (electricity, gas) type
        /// </summary>
        public enum energy_form_t
        {
            Electricity_EFT,
            Gas_EFT,
            NUM_EFT
        };

        // keyword list.
        public static List<string> m_keyword = new List<string>(new string[] 
        {
			"030101",
			"030102",
			"030201",
			"030301",
			"030302",
			"030401",
			"030501",
			"030502",
			"030601",
//			"040101",
//			"040401",
			"050101",
			"050201",
			"050401",
			"050402",
			"050501",
			"060101",
			"060102",
//			"070101",
//			"090101",
        });

		public static keyword_t[][] m_table_measure = new keyword_t[][]
		{
			new keyword_t[] {keyword_t.KWT_030101, keyword_t.KWT_030102, keyword_t.KWT_030401},	// Envelope
			new keyword_t[] {keyword_t.KWT_030301, keyword_t.KWT_030302},						// Roof
			new keyword_t[] {keyword_t.KWT_030401, keyword_t.KWT_030501, keyword_t.KWT_030601, keyword_t.KWT_030502},	// Window
			new keyword_t[] {keyword_t.KWT_030201},								// Infiltration
			new keyword_t[] {},								// IntLight
			new keyword_t[] {},								// IntEquipment
			new keyword_t[] {},								// ExtLight
			new keyword_t[] {},								// Refrigeration
			new keyword_t[] {keyword_t.KWT_050101},								// Heating
			new keyword_t[] {keyword_t.KWT_050201, keyword_t.KWT_050401, keyword_t.KWT_050402, keyword_t.KWT_050501},	// Cooling
			new keyword_t[] {keyword_t.KWT_060101, keyword_t.KWT_060102},		// Fan
		};

		public static string[][] m_table_measure_str = new string[][]
		{
			new string[] {"030101", "030102", "030401"},	// Envelope
			new string[] {"030301", "030302"},				// Roof
			new string[] {"030401", "030501", "030601", "030502"},	// Window
			new string[] {"030201"},								// Infiltration
			new string[] {"040101"},								// IntLight
			new string[] {"070101"},								// IntEquipment
			new string[] {"040401"},								// ExtLight
			new string[] {"090101"},								// Refrigeration
			new string[] {"050101"},								// Heating
			new string[] {"050201", "050401", "050402", "050501"},	// Cooling
			new string[] {"060101", "060102"},		// Fan
		};

        // energy form enum list
        public static energy_form_t[] m_energy_form = new energy_form_t[] 
        {
            energy_form_t.Gas_EFT,
            energy_form_t.Electricity_EFT,
            energy_form_t.Electricity_EFT,
            energy_form_t.Electricity_EFT,
            energy_form_t.Electricity_EFT,
            energy_form_t.Electricity_EFT,
            energy_form_t.Electricity_EFT,
            energy_form_t.Electricity_EFT,
            energy_form_t.Electricity_EFT,
            energy_form_t.Gas_EFT,
			energy_form_t.Electricity_EFT,
			energy_form_t.Gas_EFT,
			//energy_form_t.Electricity_EFT,
        };


        // energy form string
        public static string[] m_energy = new string[] 
        {
            "Electricity",
            "Gas"
        };


        /// <summary>
        /// for each keyword, how many instance we have.
        /// </summary>
        public static int[] m_inputs_num = new int[]
        {
			3,		// 030101
			12,		// 030102
			12,		// 030201
			3,		// 030301
			12,		// 030302
			11,		// 030401
			5,		// 030501
			3,		// 030502
			2,		// 030601
			8,		// 050101
			10,		// 050201
			2,		// 050401
			2,		// 050402
			2,		// 050501
			2,		// 060101
			2		// 060102
        };


        /// <summary>
        /// input strings for each keyword. 
		/// TODO, use database to maintain this table
        /// </summary>
        public static string[][] m_inputs = new string[][]
        { 
			new string[] { "0", "1", "2" },		// 030101
			new string[] { "0.27", "0.352", "0.507", "0.759", "0.908", "1.132", "1.5", "1.794", "2.228", "2.94", "3.64", "4.282"},	// 030102
			new string[] { "0.18", "0.36", "0.54", "0.72", "0.90", "1.08", "1.26", "1.44", "1.62", "1.8", "1.98", "2.16" },			// 030201
			new string[] { "0", "1", "2" },		// 030301
			new string[] { "0.25", "0.321", "0.395", "0.515", "0.607", "0.738", "0.943", "1.095", "1.305", "1.615", "1.883", "2.1"},// 030302
			new string[] { "0.0", "0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "1.0" },        // 030401
			new string[] { "0", "1", "2", "3", "4"},	// 030501
			new string[] { "0", "1", "2" },				// 030502
			new string[] { "0", "1" },					// 030601
            new string[] { "0.6", "0.65", "0.7", "0.75", "0.8", "0.85", "0.9", "0.95" },		// 050101
            new string[] { "2.8", "3.2", "3.6", "4", "4.4", "4.8", "5.2", "5.6", "6", "6.4" },	// 050201
			new string[] { "0", "1" },					// 050401
			new string[] { "0", "1" },					// 050402
			new string[] { "0", "1" },					// 050501
			new string[] { "0", "1" },					// 060101
			new string[] { "0", "1" }						// 060102
        };


        /// <summary>
        /// the selected instance index for each keyword.
        /// the index is used for query energy table
        /// please note that this table defines index starting from 1 not 0
        /// </summary>
        public static int[][] m_inputs_selected = new int[][]
        { 
            new int[] { 0, 1, 2 },								// 030101
            new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },	// 030102
            new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },	// 030201
            new int[] { 0, 1, 2 },								// 030301
            new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },	// 030302
            new int[] { 0, 2, 4, 6, 8, 10 },					// 030401
            new int[] { 0, 1, 2, 3, 4 },						// 030501
            new int[] { 0, 1, 2 },			// 030502
            new int[] { 0, 1 },				// 030601
            new int[] { 0, 1, 2, 3, 4, 5, 6, 7 },				// 050101
            new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },			// 050201
            new int[] { 0, 1 },				// 050401
            new int[] { 0, 1 },				// 050402
            new int[] { 0, 1 },				// 050501
            new int[] { 0, 1 },				// 060101
            new int[] { 0, 1 }				// 060102
        };


        /// <summary>
        /// the number of instance for each index selected
        /// </summary>
        public static int[] m_inputs_selected_num = new int[]
        { 
			3,		// 030101
			12,		// 030102
			12,		// 030201
			3,		// 030301
			12,		// 030302
			6,		// 030401
			5,		// 030501
			3,		// 030502
			2,		// 030601
			8,		// 050101
			10,		// 050201
			2,		// 050401
			2,		// 050402
			2,		// 050501
			2,		// 060101
			2		// 060102
        };

		public static string[] m_input_code = new string[]
		{
			"030101",	// 1
			"030102",	
			"030201",
			"030202",
			"030203",
			"030204",
			"030205",
			"030206",
			"030207",
			"030208",	// 10
			"030209",
			"030210",
			"030301",
			"030302",
			"030401",
			"030501",
			"030502",
			"030601",
			"040101",
			"040102",	//20
			"040201",
			"040202",
			"040301",
			"040401",
			"040501",
			"040601",
			"040602",
			"040603",
			"040604",
			"040605",	//30
			"050101",
			"050102",
			"050103",
			"050104",
			"050105",
			"050106",
			"050107",
			"050201",
			"050202",
			"050203",	//40
			"050204",
			"050205",
			"050401",
			"050402",
			"050403",
			"050501",
			"050502",
			"050503",
			"050601",
			"050602",	//50
			"050603",
			"050604",
			"060101",
			"060102",
			"060103",
			"060201",
			"060202",
			"060203",
			"060301",
			"060302",	//60
			"060303",
			"060401",
			"060402",
			"060403",
			"060404",
			"060501",
			"070101",
			"070102",
			"070103",
			"070201",	//70
			"070202",
			"080101",
			"080201",
			"080301",
			"080401",
			"080501",
			"080601",
			"090101",
			"090201",
			"090301",	//80
			"090401",
			"090501",
			"090601",
			"090701",
			"100101",
			"100201",
			"100301",
			"100401",
			"100501",
			"100601"	//90
		};

        static Keyword()
        {
        }

    };
}
